from django.core.mail import EmailMessage
from django.conf import settings
from celery import shared_task

@shared_task
def send_mail(subject,body,to):

    message = EmailMessage(subject=subject,body=body,to=[to])
    message.content_subtype = 'html'
    message.send()
    return "邮件发送成功"